package com.example.my_objectives.controller;

import com.example.my_objectives.model.Unit;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

public class UnitController extends DatabaseController {

	private Unit _model;

	public UnitController(Context context, SQLiteDatabase db) {
		super(context);
		set_database(db);
		_model = new Unit(get_database());
	}

	protected Exception createTable() {
		Exception eReturnValue = null;
		try {
			eReturnValue = _model.createTable();
			if (eReturnValue != null) {
				throw eReturnValue;
			}//if
			eReturnValue = _model.defaultInserts();
			if (eReturnValue != null) {
				throw eReturnValue;
			}//if
		}//try
		catch (Exception e) {
			eReturnValue = e;
		}//catch

		return eReturnValue;
	}

}
